<template>
    <view class="voting-completed"> 
       <view class="voting-completed-title">
        <u-image v-if="isStatus" :src="smilingFace" width="35rpx" height="35rpx"></u-image>
        <!-- <u-image v-else :src="sadFace" width="35rpx" height="35rpx"></u-image> -->
        <text  class="u-m-l-6" v-if="isStatus">您已参与{{typeText}}！</text>
        <text  class="u-m-l-6" v-else>{{isVotingInfo.status==2?'投票未开始！':'投票已结束！'}}</text>
       
       </view>
       <text class="voting-completed-time" v-if="isStatus">{{typeText}}时间：{{isVotingInfo.createDate}}</text>
     
    </view>
</template>

<script>
import smilingFace from '@/static/smilingFace.svg'
export default {
    name: 'VotingCompleted',
    data(){
        return {
            smilingFace
        }
    },
    computed:{
        isStatus(){
            return this.isVotingInfo.isVoting
        },
        isVoting(){
            let status=this.isVotingInfo.status
            let isVoting=this.isVotingInfo.isVoting
            if(status==0 ||status==2){
                return false
            }
            if(isVoting){
                return true
            }
            return false
        },
        typeText(){

            let type=this.type
            
            if(type==1){
                return '投票'
            }else if(type==2){
                return '快速决议'
            }else if(type==3){
                return '问卷调查'   
            }else if(type==4){
                return '倡议书'
            }
        }
    },
    props:{
        isVotingInfo:{
            type:Object,
            default:()=>{}
        },
        type:{
            type:String,
          
        }
    }
}
</script>

<style scoped>
.voting-completed{
    width: 100%;
    height: 88rpx;
   
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}
.voting-completed-title{
    font-weight: 600;
    font-size: 30rpx;
    color: #333333;
    display: flex;
    align-items: center;
}
.voting-completed-time{
    margin-top:6rpx ;
    font-weight: 400;
    font-size: 28rpx;
    color: #666666;

}

</style>